package com.wt.util.axios;

import com.alibaba.fastjson.JSONObject;
import java.util.HashMap;

public class JsonToEntity {
    public static HashMap<String, String> wqunAccount(JSONObject jsonObject){
        HashMap<String, String> map = new HashMap<>();
        //获取前端传入数据中的用户名和密码，到数据库中进行查询
        if(jsonObject.getString("id") != null){
            map.put("id",jsonObject.getString("id"));
        }
        if(jsonObject.getString("phone") != null){
            map.put("phone",jsonObject.getString("phone"));
        }
        if(jsonObject.getString("userName") != null){
            map.put("userName",jsonObject.getString("userName"));
        }
        if(jsonObject.getString("nickName") != null){
            map.put("nickName",jsonObject.getString("nickName"));
        }
        if(jsonObject.getString("sex") != null){
            map.put("sex",jsonObject.getString("sex"));
        }
        if(jsonObject.getString("userType") != null){
            map.put("userType",jsonObject.getString("userType"));
        }
        if(jsonObject.getString("email") != null){
            map.put("email",jsonObject.getString("email"));
        }
        if(jsonObject.getString("avatar") != null){
            map.put("avatar",jsonObject.getString("avatar"));
        }
        if(jsonObject.getString("pass") != null){
            map.put("pass",jsonObject.getString("pass"));
        }
        if(jsonObject.getString("salt") != null){
            map.put("salt",jsonObject.getString("salt"));
        }
        if(jsonObject.getString("isDelete") != null){
            map.put("isDelete",jsonObject.getString("isDelete"));
        }
        if(jsonObject.getString("createBy") != null){
            map.put("createBy",jsonObject.getString("createBy"));
        }
        if(jsonObject.getString("createdTime") != null){

            map.put("createdTime",jsonObject.getString("createdTime"));
        }
        if(jsonObject.getString("modifiedTime") != null){
            map.put("modifiedTime",jsonObject.getString("modifiedTime"));
        }
        if(jsonObject.getString("modifiedTime") != null){
            map.put("modifiedTime",jsonObject.getString("modifiedTime"));
        }
        if(jsonObject.getString("updateBy") != null){
            map.put("updateBy",jsonObject.getString("updateBy"));
        }

        return map;
    }

    public static HashMap<String, String> LoginAccount(JSONObject jsonObject){
        HashMap<String, String> map = new HashMap<>();
        //获取前端传入数据中的用户名和密码，到数据库中进行查询
        if(jsonObject.getString("accountPhone") != null){
            map.put("accountPhone",jsonObject.getString("accountPhone"));
        }
        if(jsonObject.getString("accountPass") != null){
            map.put("accountPass",jsonObject.getString("accountPass"));
        }
        if(jsonObject.getString("imgCode") != null){
            map.put("imgCode",jsonObject.getString("imgCode"));
        }
        return map;

    }


    public static HashMap<String, String> wqunCommunity(JSONObject jsonObject){
        HashMap<String, String> map = new HashMap<>();
        //获取前端传入数据中的用户名和密码，到数据库中进行查询
        if(jsonObject.getString("id") != null){
            map.put("id",jsonObject.getString("id"));
        }
        if(jsonObject.getString("crowdNo") != null){
            map.put("crowdNo",jsonObject.getString("crowdNo"));
        }
        if(jsonObject.getString("uid") != null){
            map.put("uid",jsonObject.getString("uid"));
        }
        if(jsonObject.getString("avatar") != null){
            map.put("avatar",jsonObject.getString("avatar"));
        }
        if(jsonObject.getString("toUid") != null){
            map.put("toUid",jsonObject.getString("toUid"));
        }
        if(jsonObject.getString("toUserUid") != null){
            map.put("toUserUid",jsonObject.getString("toUserUid"));
        }
        if(jsonObject.getString("content") != null){
            map.put("content",jsonObject.getString("content"));
        }
        if(jsonObject.getString("fileName") != null){
            map.put("fileName",jsonObject.getString("fileName"));
        }
        if(jsonObject.getString("isDelete") != null){
            map.put("isDelete",jsonObject.getString("isDelete"));
        }
        if(jsonObject.getString("type") != null){
            map.put("type",jsonObject.getString("type"));
        }
        if(jsonObject.getString("createdTime") != null){
            map.put("createdTime",jsonObject.getString("createdTime"));
        }
        if(jsonObject.getString("modifiedTime") != null){
            map.put("modifiedTime",jsonObject.getString("modifiedTime"));
        }

        return map;

    }
}
